-
Notifications
You must be signed in to change notification settings - Fork 2
ENH: Give Error message when no conda env is present #120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…tion is not installed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll leave for this for @certik to give a look.
if [[ -z "$CONDA_PREFIX" ]]; then | ||
echo -e "${RED}Error: No Conda environment is active. Please activate a conda env with MPI installed.${NC}" | ||
exit 1 | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if the user has global installation of MPI implementation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This condition might cause false negative.
echo -e "${RED}Error: mpiexec not found. Please install MPI (OpenMPI or MPICH) via Conda or system package manager.${NC}" | ||
exit 1 | ||
fi | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checking for existence of ${CONDA_PREFIX}/bin/mpiexec
doesn't detect MPI compilers, include paths, or libraries. We are only checking for runtime control here.
The correct approach probably will be to eventually use cmake build system for us. We've an open issue for this: #19
The current approach isn't the best one though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked pFUnit repository, the way they check the existence of MPI is using cmake's find_package
using:
find_package (MPI QUIET COMPONENTS Fortran)
if (MPI_Fortran_FOUND)
message (STATUS "MPI enabled")
if (ENABLE_MPI_F08)
if (NOT MPI_Fortran_HAVE_F08_MODULE)
message (FATAL_ERROR "MPI F08 module requested but not available")
else()
message (STATUS "MPI F08 module enabled")
endif()
endif()
else ()
message (STATUS "MPI not found; building without MPI")
endif()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ohh YEs i Didn't see that CMAKE issue Thanks for mentioning it.
We can avoid this approach if not needed.
This is just small error message as when no conda env is activated then there is no MPI or MPICH is present so user gets confused on what to do (Also we observed on call too).
(This also can be avoided I felt it to be included that's why :)
Earlier case
With this PR